#!/bin/sh

skippedFile="${skippedFile}"; 
if [ -f "$skippedFile" ]; then 
skipped=`cat $skippedFile`; 
fi 
if [ "$1" = "fetch" ] || [ "$2" = "fetch" ]; then
fetch="fetch"; 
fi 
if [ "$1" = "build" ] || [ "$2" = "build" ]; then
build="build"; 
fi 

if [ "$fetch" = "fetch" ]; then

<#list ports as p>
skip=`echo "$skipped" | grep ${p.name}`;
if [ -n "$skip" ]; then 
echo "skipping ${p.name} ...";
else
cd ${p.portDir} && make fetch
fi

</#list>
fi
#end of fetch

if [ "$build" = "build" ]; then
<#list ports as p>
skip=`echo "$skipped" | grep ${p.name}`;
if [ -n "$skip" ]; then 
echo "skipping ${p.name} ...";
else
cd ${p.portDir} && make && make deinstall && make install
fi

</#list>
fi
#end of build

